package net.wangds.common.web.fileupload.module;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import net.wangds.data.impl.IdCreate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

/**
 * .
 * <p></p>
 *
 * @author 王东石 2020/5/15 12:27.
 */
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@Entity
@Table(name=UploadFileEntity.TABLE_NAME, indexes = {
        @Index(columnList = "md5"),
        @Index(columnList = "md5,size")
})
public class UploadFileEntity extends IdCreate {

    public static final String TABLE_NAME = "common_upload_files";

    private static final long serialVersionUID = 0;
    @Getter
    @Setter
    @Column(length = 256)
    private String filename;

    @Getter
    @Setter
    @Column(length=10)
    private long size;

    @Getter
    @Setter
    @Column(length=500)
    private String type;

    @Getter
    @Setter
    private long fileTm;

    @Getter
    @Setter
    @Column(length = 32)
    private String md5;

    @Getter
    @Setter
    @Column(length = 100)
    private String fileOwner;
}
